﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Employees.ascx.cs" Inherits="PayrollHR.Administration.Modules.Employees" %>
<%@ Register Src="CustomerSearch.ascx" TagName="CustomerSearch" TagPrefix="uc1" %>

<%@ Register Src="ConfirmationBox.ascx" TagName="ConfirmationBox" TagPrefix="uc2" %>
<%@ Register src="EmployeeSearch.ascx" tagname="EmployeeSearch" tagprefix="uc3" %>
<script type="text/javascript">
    $(window).bind('load', function () {
        var cbHeader = $(".cbHeader input");
        var cbRowItem = $(".cbRowItem input");
        cbHeader.bind("click", function () {
            cbRowItem.each(function () { this.checked = cbHeader[0].checked; })
        });
        cbRowItem.bind("click", function () { if ($(this).checked == false) cbHeader[0].checked = false; });
    });
</script>
<asp:UpdatePanel ID="upForumSubscriptions" runat="server">
     <ContentTemplate>
            <div class="section-header">
            <div class="title">
                <img src="Common/ico-customers.png" alt="Admin.Customers.ManagerCustomer" />
                <%=GetLocaleResourceString("Admin.Customers.ManagerCustomer")%>
            </div>
            <div class="options">
                <asp:HyperLink runat="server" Visible="False" ID="hlexport" ForeColor="#6600CC">[hlexport]</asp:HyperLink>
                <asp:Button ID="SearchButton" runat="server" Text="Filter"
                    CssClass="adminButtonBlue"  ToolTip="Filter" OnClick="SearchButton_Click" />
           
              
                <asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="adminButtonBlue" ValidationGroup="ExportXLS" ToolTip="Delete Customer" OnClick="btnDelete_Click" />
          
                <uc2:ConfirmationBox ID="cbDelete" runat="server" TargetControlID="btnDelete"
                    YesText="<% $PayrollResources:Admin.Common.Yes %>" NoText="<% $PayrollResources:Admin.Common.No %>"
                    ConfirmText="<% $PayrollResources:Admin.Common.AreYouSure %>" />
                <input type="button" onclick="location.href = 'addEmployee.aspx'" value="<%=GetLocaleResourceString("Admin.Customers.AddNew")%>"
                    id="btnAddNew" class="adminButtonBlue" title="<%=GetLocaleResourceString("Admin.Customers.AddNew")%>" />
            </div>
        </div>
           <div>
               <uc3:EmployeeSearch ID="ctrEmployeeSearch" runat="server" />
        </div>
         <asp:GridView ID="gvEmployees" AutoGenerateColumns="False" Width="100%" runat="server" DataKeyNames="EmployeeId">
    <Columns>
             <asp:TemplateField ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center">
                    <HeaderTemplate>
                        <asp:CheckBox ID="cbSelectAll" runat="server" CssClass="cbHeader" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="cbEmployeeInfo" runat="server" CssClass="cbRowItem" ToolTip="<% $PayrollResources:Admin.Customers.CustName.ToolTip %>" />
                        <asp:HiddenField ID="hfEmployeeID" runat="server" Value='<%# Eval("EmployeeId") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
        <asp:TemplateField HeaderText="Họ Tên">
             <ItemTemplate>
                        <%#Server.HtmlEncode(Eval("Name").ToString())%>
             </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="UserName">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("Username").ToString())%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Số điện thoại (Mobile)">
            <ItemTemplate>
                 <%#Server.HtmlEncode(Eval("Mobile") != null ? Eval("Mobile").ToString() : "")%>
            </ItemTemplate>
        </asp:TemplateField>
       <asp:TemplateField HeaderText="Email">
           <ItemTemplate>
                  <%#Server.HtmlEncode(Eval("EmailAddress") != null ? Eval("EmailAddress").ToString() : "")%>
           </ItemTemplate>
       </asp:TemplateField>

                <asp:TemplateField HeaderText="Sửa" HeaderStyle-HorizontalAlign="Center"
                    ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <a href="addEmployee.aspx?Id=<%# Eval("EmployeeId")%>" title="Action">Edit
                        </a>
                    </ItemTemplate>
                </asp:TemplateField>
    </Columns>
</asp:GridView>
     </ContentTemplate>
    </asp:UpdatePanel>
<asp:UpdateProgress ID="up1" runat="server" AssociatedUpdatePanelID="upForumSubscriptions">
    <ProgressTemplate>
        <div class="progress">
            <asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="~/images/UpdateProgress.gif"
                AlternateText="update" />
            <%=GetLocaleResourceString("Admin.Common.Wait...")%>
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>






